<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<div th:replace="~{common/common::head}"></div>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <fieldset class="layui-elem-field layui-field-title">
                    <legend><a style="color: rgb(30 159 255)" class="memshell">内存马攻击</a></legend>
                    <blockquote class="layui-elem-quote layui-quote-nm"
                                style="font-size: 15px;background-color: #a7deefab;box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075) !important">
                        <p>
                        <pre>   内存马是一种高级的Web后门技术，它通过将恶意代码注入到Web服务器的内存中来实现持久化。与传统的文件后门相比，内存马更难被检测和清除。</pre>
                        </p>
                        <p>
                        <pre>   内存马通常利用Web容器的特性，如Filter、Servlet、Listener等组件来实现。攻击者可以通过注入这些组件来获取服务器的控制权，执行任意命令。</pre>
                        </p>
                    </blockquote>
                </fieldset>
            </div>

            <div class="layui-col-md12" style="margin-top: 10px">
                <div class="layui-row layui-col-space15">
                    <div class="layui-col-md6">
                        <h1><span class="iconfont icon-bug">  漏洞场景：Filter型内存马</span></h1>
                        <div class="layui-tab layui-tab-brief">
                            <ul class="layui-tab-title">
                                <li class="layui-this">注入</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <blockquote class="layui-elem-quote main_btn">
                                        <form class="layui-form" style="display: flex; justify-content: space-between;">
                                            <div style="display: flex; align-items: center;">
                                                <input type="text" name="cmd" style="width: 150px;" required
                                                       lay-verify="required" placeholder="命令" autocomplete="off"
                                                       class="layui-input">
                                            </div>
                                            <div style="display: flex; align-items: center;">
                                                <select class="layui-form-select"
                                                        style="background-color: #5eb878;!important;">
                                                    <option value="">示例命令</option>
                                                    <option value="0">whoami</option>
                                                    <option value="1">ipconfig</option>
                                                    <option value="2">dir</option>
                                                </select>
                                                <button class="layui-btn layui-btn-normal"
                                                        style="width: 100px; margin-left: 10px;"
                                                        lay-filter="vul1-filter-inject" lay-submit="">
                                                    <span class="iconfont icon-zhihang">Run</span>
                                                </button>
                                            </div>
                                        </form>
                                    </blockquote>
                                </div>
                                <div class="layui-col-md12">
                                    <div class="layui-card">
                                        <div class="layui-card-header"><i class="fa fa-warning icon-output"></i>测试结果</div>
                                        <div class="layui-card-body layui-text layadmin-text">
                                            <pre id="vul1-filter-result" style="color: red;font-size: 15px;"></pre>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-col-md6">
                        <h1><span class="iconfont icon-code">  缺陷代码</span></h1>
                        <div class="m-auto div-shadow shadow p-3 mb-5 bg-white rounded">
                            <div class="code-editor" id="vul1Filter">
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-col-md12" style="margin-top: 10px">
                <div class="layui-row layui-col-space15">
                    <div class="layui-col-md6">
                        <h1><span class="iconfont icon-bug">  漏洞场景：Servlet型内存马</span></h1>
                        <div class="layui-tab layui-tab-brief">
                            <ul class="layui-tab-title">
                                <li class="layui-this">注入</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <blockquote class="layui-elem-quote main_btn">
                                        <form class="layui-form" style="display: flex; justify-content: space-between;">
                                            <div style="display: flex; align-items: center;">
                                                <input type="text" name="cmd" style="width: 150px;" required
                                                       lay-verify="required" placeholder="命令" autocomplete="off"
                                                       class="layui-input">
                                            </div>
                                            <div style="display: flex; align-items: center;">
                                                <select class="layui-form-select"
                                                        style="background-color: #5eb878;!important;">
                                                    <option value="">示例命令</option>
                                                    <option value="0">whoami</option>
                                                    <option value="1">ipconfig</option>
                                                    <option value="2">dir</option>
                                                </select>
                                                <button class="layui-btn layui-btn-normal"
                                                        style="width: 100px; margin-left: 10px;"
                                                        lay-filter="vul2-servlet-inject" lay-submit="">
                                                    <span class="iconfont icon-zhihang">Run</span>
                                                </button>
                                            </div>
                                        </form>
                                    </blockquote>
                                </div>
                                <div class="layui-col-md12">
                                    <div class="layui-card">
                                        <div class="layui-card-header"><i class="fa fa-warning icon-output"></i>测试结果</div>
                                        <div class="layui-card-body layui-text layadmin-text">
                                            <pre id="vul2-servlet-result" style="color: red;font-size: 15px;"></pre>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-col-md6">
                        <h1><span class="iconfont icon-code">  缺陷代码</span></h1>
                        <div class="m-auto div-shadow shadow p-3 mb-5 bg-white rounded">
                            <div class="code-editor" id="vul2Servlet">
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-col-md12" style="margin-top: 10px">
                <div class="layui-row layui-col-space15">
                    <div class="layui-col-md6">
                        <h1><span class="iconfont icon-bug">  漏洞场景：Listener型内存马</span></h1>
                        <div class="layui-tab layui-tab-brief">
                            <ul class="layui-tab-title">
                                <li class="layui-this">注入</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <blockquote class="layui-elem-quote main_btn">
                                        <form class="layui-form" style="display: flex; justify-content: space-between;">
                                            <div style="display: flex; align-items: center;">
                                                <input type="text" name="cmd" style="width: 150px;" required
                                                       lay-verify="required" placeholder="命令" autocomplete="off"
                                                       class="layui-input">
                                            </div>
                                            <div style="display: flex; align-items: center;">
                                                <select class="layui-form-select"
                                                        style="background-color: #5eb878;!important;">
                                                    <option value="">示例命令</option>
                                                    <option value="0">whoami</option>
                                                    <option value="1">ipconfig</option>
                                                    <option value="2">dir</option>
                                                </select>
                                                <button class="layui-btn layui-btn-normal"
                                                        style="width: 100px; margin-left: 10px;"
                                                        lay-filter="vul3-listener-inject" lay-submit="">
                                                    <span class="iconfont icon-zhihang">Run</span>
                                                </button>
                                            </div>
                                        </form>
                                    </blockquote>
                                </div>
                                <div class="layui-col-md12">
                                    <div class="layui-card">
                                        <div class="layui-card-header"><i class="fa fa-warning icon-output"></i>测试结果</div>
                                        <div class="layui-card-body layui-text layadmin-text">
                                            <pre id="vul3-listener-result" style="color: red;font-size: 15px;"></pre>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-col-md6">
                        <h1><span class="iconfont icon-code">  缺陷代码</span></h1>
                        <div class="m-auto div-shadow shadow p-3 mb-5 bg-white rounded">
                            <div class="code-editor" id="vul3Listener">
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-col-md12" style="margin-top: 10px">
                <div class="layui-row layui-col-space15">
                    <div class="layui-col-md6">
                        <h1><span class="iconfont icon-anquan">  安全场景：内存马检测</span></h1>
                        <div class="layui-tab layui-tab-brief">
                            <ul class="layui-tab-title">
                                <li class="layui-this">检测</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <blockquote class="layui-elem-quote main_btn">
                                        <form class="layui-form" style="display: flex; justify-content: space-between;">
                                            <div style="display: flex; align-items: center;">
                                                <select name="type" class="layui-form-select" style="width: 150px;">
                                                    <option value="filter">Filter</option>
                                                    <option value="servlet">Servlet</option>
                                                    <option value="listener">Listener</option>
                                                </select>
                                            </div>
                                            <div style="display: flex; align-items: center;">
                                                <button class="layui-btn layui-btn-normal"
                                                        style="width: 100px; margin-left: 10px;"
                                                        lay-filter="safe1-detect" lay-submit="">
                                                    <span class="iconfont icon-zhihang">Run</span>
                                                </button>
                                            </div>
                                        </form>
                                    </blockquote>
                                </div>
                                <div class="layui-col-md12">
                                    <div class="layui-card">
                                        <div class="layui-card-header"><i class="fa fa-warning icon-output"></i>测试结果</div>
                                        <div class="layui-card-body layui-text layadmin-text">
                                            <pre id="safe1-detect-result" style="color: red;font-size: 15px;"></pre>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-col-md6">
                        <h1><span class="iconfont icon-code">  安全代码</span></h1>
                        <div class="m-auto div-shadow shadow p-3 mb-5 bg-white rounded">
                            <div class="code-editor" id="safe1Detect">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:replace="~{common/common::script}"></div>

<script type="text/javascript">
    layui.use(['layer', 'miniTab', 'common'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            miniTab = layui.miniTab,
            common = layui.common;
        miniTab.listen();
        layer.msg("内存马攻击")

        common.formListenFun("vul1-filter-inject", "inject", "/memshell/filter/inject", "vul1-filter-result","post");
        common.formListenFun("vul2-servlet-inject", "inject", "/memshell/servlet/inject", "vul2-servlet-result","post");
        common.formListenFun("vul3-listener-inject", "inject", "/memshell/listener/inject", "vul3-listener-result","post");
        common.formListenFun("safe1-detect", "detect", "/memshell/safe/detect", "safe1-detect-result","get");

        var cmConfig = {
            lineNumbers: true,
            lineWrapping: false,
            indentUnit: 4,
            indentWithTabs: true,
            theme: 'juejin',
            styleActiveLine: {nonEmpty: true},
            fontSize: "18px",
            mode: "text/x-java"
        };

        CodeMirror(document.getElementById("vul1Filter"), Object.assign({}, cmConfig, {
            value: vul1Filter
        }));
        CodeMirror(document.getElementById("vul2Servlet"), Object.assign({}, cmConfig, {
            value: vul2Servlet
        }));
        CodeMirror(document.getElementById("vul3Listener"), Object.assign({}, cmConfig, {
            value: vul3Listener
        }));
        CodeMirror(document.getElementById("safe1Detect"), Object.assign({}, cmConfig, {
            value: safe1Detect
        }));
    });
</script>

</body>
</html> 